<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Hello Vue</title>
</head>

<body>
    <div id="app">
        <h2>文本插值</h2>
        <p><label>变量：</label>{{ title }}</p>
        <p><label>表达式：</label>{{ 4+5 }}</p>
        <p><label>三目运算：</label>{{ flag ? 4: 5 }}</p>
        <p><label>一般函数：</label>{{ getName() }}</p>
        <p><label>匿名函数：</label>{{ (() => 4+5)() }}</p>
        <p><label>对象：</label>{{ { num: 5 } }}</p>
        <p><label>函数对象：</label>{{ getName }}</p>
    </div>
    <script src="https://unpkg.com/vue@next"></script>
    <script type="text/javascript">
        const App = {
            data() {
                return {
                    title: 'Hello Vue',
                    flag: true,
                    html: '<span>I am sam.</span>'
                }
            },
            methods: {
                getName() {
                    return 'xiaoxiao'
                }
            }
        }
        Vue.createApp(App).mount('#app')
    </script>
</body>

</html>